﻿using System;
using System.Collections.Generic;

namespace Acoris.Template
{
    using Acoris.Foundation;
    using Acoris.Media;
    using Acoris.Rendering;

    /// <summary>
    /// 表示一个样式元素
    /// </summary>
    public sealed class Style : IEqualityComparer<Style>
    {

        /*
         * 应用模板内容在Composition阶段
         * Animation的计算也发生在Composition阶段
         */

        #region Background

        /// <summary>
        /// 获取或设置背景画刷
        /// </summary>
        public Brush Background { get; set; }

        /// <summary>
        /// 获取或设置透明度
        /// </summary>
        public float Opacity { get; set; }

        /// <summary>
        /// 获取或设置前景画刷
        /// </summary>
        public Brush Foreground { get; set; }

        /// <summary>
        /// 获取或设置笔画画刷
        /// </summary>
        public Brush Stroke { get; set; }

        /// <summary>
        /// 获取或设置填充画刷
        /// </summary>
        public Brush Fill { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Stretch Stretch { get; set; }

        #endregion

        #region Margin / Padding

        /// <summary>
        /// 获取或设置外边距
        /// </summary>
        public Thickness Margin { get; set; }

        /// <summary>
        /// 获取或设置内边距
        /// </summary>
        public Thickness Padding { get; set; }

        #endregion

        #region Text / Font / Indent / LineGap

        /// <summary>
        /// 获取或设置字体
        /// </summary>
        public string FontFamily { get; set; }

        /// <summary>
        /// 获取或设置字体大小
        /// </summary>
        public float FontSize { get; set; }

        /// <summary>
        /// 获取或设置缩进增量
        /// </summary>
        public float IndentIncreament { get; set; }

        /// <summary>
        /// 获取或设置缩进个数
        /// </summary>
        public float IndentCount { get; set; }

        /// <summary>
        /// 获取或设置行距
        /// </summary>
        public float LineGap { get; set; }

        /// <summary>
        /// 获取或设置字距
        /// </summary>
        public float CharacterSpacing { get; set; }

        #endregion

        #region SubScript / SuperScript

        /// <summary>
        /// 获取或设置当前元素是否作为下标
        /// </summary>
        public bool SubScript { get; set; }

        /// <summary>
        /// 获取或设置元素下标缩放级别
        /// </summary>
        public float SubscriptLevel { get; set; }

        /// <summary>
        /// 获取或设置当前元素是否作为上标
        /// </summary>
        public bool SuperScript { get; set; }

        /// <summary>
        /// 获取或设置元素上标缩放级别
        /// </summary>
        public float SuperscriptLevel { get; set; }

        #endregion

        #region StrokeStyle / ListStyle 

        /// <summary>
        /// 获取或设置列表元素的装饰
        /// </summary>
        public object ListDecoration { get; set; }
        
        /// <summary>
        /// 获取或设置当前元素的笔画样式
        /// </summary>
        public object StrokeStyle { get; set; }

        #endregion

        #region Transform

        /// <summary>
        /// 获取或设置当前元素的图形变换
        /// </summary>
        public Transform Transform { get; set; }

        #endregion

        #region Border / Radius / Thickness

        /// <summary>
        /// 获取或设置当前元素的边框
        /// </summary>
        public Thickness BorderThickness { get; set; }

        /// <summary>
        /// 获取或设置当前元素的边框色
        /// </summary>
        public Brush BorderBrush { get; set; }

        /// <summary>
        /// 获取或设置当前元素的X轴圆角半径
        /// </summary>
        public float RadiusX { get; set; }

        /// <summary>
        /// 获取或设置当前元素的Y轴圆角半径
        /// </summary>
        public float RadiusY { get; set; }
        #endregion

        #region Apply

        /// <summary>
        /// 获取或设置当前模板应用的目标元素
        /// </summary>
        public Type TargetType { get; set; }

        // Priority: TargetClass > TargetType

        /// <summary>
        /// 获取或设置当前模板应用的目标元素Id
        /// </summary>
        /// <remarks>该元素一旦被赋予非负值则Type无效</remarks>
        public string TargetClass { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int ClassID { get; set; }        

        #endregion

        #region Override

        /// <summary>
        /// 获取与当前对象等价的字符串形式
        /// </summary>
        /// <returns>返回与当前对象等价的字符串形式</returns>
        public override string ToString()
        {
            return base.ToString();
        }

        /// <summary>
        /// 获取当前对象与指定对象之间的等价性
        /// </summary>
        /// <param name="obj">指定要比较的对象</param>
        /// <returns>如果两个对象之间等价则返回true，否则返回false</returns>
        public override bool Equals(object obj)
        {
            return false;
        }

        /// <summary>
        /// 获取当前对象的哈希值
        /// </summary>
        /// <returns>返回当前对象的哈希值</returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        #endregion

        #region IEqualityComparer<Style>接口成员

        public bool Equals(Style x, Style y)
        {
            throw new NotImplementedException();
        }

        public int GetHashCode(Style obj)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
